<!DOCTYPE HTML>
<html  lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-iLine-edit" th:object="${iLine}">
            <input id="id" name="id" th:field="*{id}"  type="hidden">
			<input name="upLineId" type="hidden" id="line_id"/>
			<input name="byqId" type="hidden" id="byq_id" th:value="*{byqId}"/>
			<div class="form-group">
				<label class="col-sm-3 control-label">线路名称：</label>
				<div class="col-sm-8">
					<input id="name" name="name" th:field="*{name}" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">运行编号：</label>
				<div class="col-sm-8">
					<input id="runCode" name="runCode" th:field="*{runCode}" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">线路类型：</label>
				<div class="col-sm-8">
					<!--<input id="lineType" name="lineType" th:field="*{lineType}" class="form-control" type="text">-->
					<!--<select id="lineType" class="form-control" name="lineType"-->
							<!--th:with="type=${@dict.getType('line_type')}">-->
						<!--<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{lineType}"></option>-->
					<!--</select>-->
					<select id="lineType" class="form-control" name="lineType" th:field="*{lineType}">
						<option value="架空线">架空线</option>
						<option value="电缆线">电缆线</option>
					</select>

				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">电压等级：</label>
				<div class="col-sm-8">
					<!--<input id="voltage" name="voltage" th:field="*{voltage}" class="form-control" type="text">-->
					<!--<select id="voltage" class="form-control" name="voltage"-->
							<!--th:with="type=${@dict.getType('voltage_grade')}">-->
						<!--<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{voltage}"></option>-->
					<!--</select>-->
					<select id="voltage" class="form-control" name="voltage" th:field="*{voltage}">
						<option value="10kv">10kv</option>
						<option value="400v">400v</option>
						<option value="220v">220v</option>
					</select>
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">线路总长度：</label>
				<div class="col-sm-8">
					<input id="totalSpan" name="totalSpan" th:field="*{totalSpan}" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">架空线路总长度：</label>
				<div class="col-sm-8">
					<input id="overSpan" name="overSpan" th:field="*{overSpan}" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">电缆总长度：</label>
				<div class="col-sm-8">
					<input id="cableSpan" name="cableSpan" th:field="*{cableSpan}" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">变压器：</label>
				<div class="col-sm-8">
					<input id="byq_name" name="byqName" th:field="*{byqName}" class="form-control" type="text" onclick="chooseByq()">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">上级线路：</label>
				<div class="col-sm-8">
					<input id="line_name" name="upLineName" th:field="*{upLineName}" class="form-control" type="text" onclick="chooseUpLine()">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">资产单位：</label>
				<div class="col-sm-8">
					<input id="unit" name="unit" th:field="*{unit}" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">运维班组：</label>
				<div class="col-sm-8">
					<input id="runTeam" name="runTeam" th:field="*{runTeam}" class="form-control" type="text">
				</div>
			</div>
			<!--<div class="form-group">
				<label class="col-sm-3 control-label">创建人：</label>
				<div class="col-sm-8">
					<input id="addUser" name="addUser" th:field="*{addUser}" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">创建日期：</label>
				<div class="col-sm-8">
					<input id="addDate" name="addDate" th:field="*{addDate}" class="form-control" type="date">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">最近更新人：</label>
				<div class="col-sm-8">
					<input id="updateUser" name="updateUser" th:field="*{updateUser}" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">最近更新日期：</label>
				<div class="col-sm-8">
					<input id="updateDate" name="updateDate" th:field="*{updateDate}" class="form-control" type="date">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">数据状态：</label>
				<div class="col-sm-8">
					<input id="datastate" name="datastate" th:field="*{datastate}" class="form-control" type="text">
				</div>
			</div>-->
		</form>
    </div>
    <div th:include="include::footer"></div>
    <script type="text/javascript">
		var prefix = ctx + "assets/iLine";

		var byqId = $("#byq_id").val();

		$("#form-iLine-edit").validate({
			rules:{
				xxxx:{
					required:true,
				},
			},
			focusCleanup: true
		});
		
		function submitHandler() {
	        if ($.validate.form()) {
	            $.operate.save(prefix + "/edit", $('#form-iLine-edit').serialize());
	        }
	    }


        /**
         * 	选择变压器
         */
        function chooseByq(){
            //	打开方式一
            layer.open({
                type: 2,
                title: '变压器选择',
                area: ['950px', '340px'],
                fixed: false, //不固定
                maxmin: true,
                content: ctx+"assets/bByq/chooseByq",
                btn: ['确定', '关闭'],
                // 弹层外区域关闭
                shadeClose: true,
                yes: function (index,layero) {
                    var body = layer.getChildFrame('body', index);//得到iframe页的body内容
                    $("#byq_id").val(body.find('#byq_id').val());
                    $("#byq_name").val(body.find('#byq_name').val());
                    layer.close(index);
                },
                cancel: function(index) {
                    return true;
                }
            });
        }


        /**
         * 	选择上级线路
         */
        function chooseUpLine(){

            var id = $("#id").val();
            console.log("线路id=="+id)

            //	打开方式一
            layer.open({
                type: 2,
                title: '上级线路选择',
                area: ['950px', '340px'],
                fixed: false, //不固定
                maxmin: true,
//                content: ctx+"assets/b10kvLineInfo/choose10kvLine",
                content: ctx+"assets/iLine/chooseLineForId/"+id+"/"+byqId,
                btn: ['确定', '关闭'],
                // 弹层外区域关闭
                shadeClose: true,
                yes: function (index,layero) {
                    var body = layer.getChildFrame('body', index);//得到iframe页的body内容
                    $("#line_id").val(body.find('#line_id').val());
                    $("#line_name").val(body.find('#line_name').val());
                    layer.close(index);
                },
                cancel: function(index) {
                    return true;
                }
            });
        }
	</script>
</body>
</html>
